home *** CD-ROM | disk | FTP | other *** search
- Path: news.PBI.net!usenet
- From: mich@pbinet.com
- Newsgroups: comp.lang.c
- Subject: Re: How to tell if a file exists in C
- Date: 24 Feb 1996 21:55:20 GMT
- Organization: Pacific Bell Internet Services
- Message-ID: <4go1g8$qg3@SNFC21_SRVR_WWW.PBI.net>
- References: <4eqkj6$ipo@charm.magnus.acs.ohio-state.edu> <m2pwbuvfb9.fsf@hawk.no>
- Reply-To: mich@pbinet.com
- NNTP-Posting-Host: ppp-5-9.rdcy01.pbinet.com
- X-Newsreader: IBM NewsReader/2 v1.03
-
- > : Hi, how do I find out if a file already exists
- > : in UNIX C? On PCs I would do a findfirst/findnext,
- > : is there an equivalent on Unix?
-
- >Use the stat function, e.g.:
-
- One could also simply open() the file for read-only and check the return code.
-
-